package com.zerui.manager.app.operationrecord;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zerui.cola.dto.PageResponse;
import com.zerui.manager.app.operationrecord.executer.OperationRecordQryCmdExe;
import com.zerui.manager.web.OperationRecordService;
import com.zerui.manager.web.cmd.OperationRecordCmd;
import com.zerui.manager.web.vo.OperationRecordVO;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;

/**
 * @Author wh
 * @create_time 2023-08-23 11:08
 */
@Service
public class OperationRecordServiceImpl implements OperationRecordService {

	@Resource
	private OperationRecordQryCmdExe operationRecordQryCmdExe;
	@Override
	public PageResponse<OperationRecordVO> getPageList(OperationRecordCmd operationRecordCmd) {
		Page<OperationRecordVO> operationRecordVoPage = operationRecordQryCmdExe.execute(operationRecordCmd);
		return PageResponse.of(operationRecordVoPage.getRecords(),(int)operationRecordVoPage.getTotal(),
				(int) operationRecordVoPage.getSize(),
				(int) operationRecordVoPage.getCurrent());
	}
}
